export const meta = {
  title: "prisma1 login",
  position: 240,
}

## `$ prisma1 login`

Authenticate with [Prisma Cloud](https://www.prisma.io/cloud). 

This command opens the [Prisma Cloud Console](https://app.prisma.io/) where you need to sign up or sign in.

After a successful authentication in the browser, the CLI writes the `cloudSessionKey` into `~/.prisma/config.yml`. From there it is used for all subsequent requests made by the CLI against Prisma Cloud.

Note that rather than providing your cloud session key via the `--key` flag, you can also set the `PRISMA_CLOUD_SESSION_KEY` environment variable, this is especially useful for CI environments.

### Usage

```sh
prisma1 login [flags]
```

### Flags

```
-k, --key KEY    Cloud session key
```

### Examples

**Authenticate with Prisma Cloud (opens browser)**

```sh
prisma1 login
```

**Authenticate with Prisma Cloud by manually passing the cloud session key**

```sh
prisma1 login --key KEY
```

> In the above command, the `KEY` placeholder needs to be replaced with the value of your valid cloud session key. You can find the `cloudSessionKey` in `~/.prisma/config.yml`.

## Workaround for Windows subsystem on Linux

1. Go to the [Prisma Console](https://app.prisma.io) and create an account. Log in. Leave that window open.
1. In the WSL bash window, run `prisma1 login`, and grant the CLI permissions as requested in the browser window that Windows shows you.

> Learn more [here](https://github.com/prisma/prisma-content-feedback/issues/38).